import lombok.Data;

@Data
public class CourseInnerBuilder {
    private String name;
    private String PPT;
    private String video;
    private String note;
    private String homework;

    public static class Builder{
        private CourseInnerBuilder course = new CourseInnerBuilder();

        Builder(){

        }

        public Builder addName(String name){
            course.setName(name);
            return this;
        }

        public Builder addPPT(String PPT){
            course.setPPT(PPT);
            return this;
        }

        public Builder addVideo(String video){
            course.setVideo(video);
            return this;
        }

        public Builder addNote(String note){
            course.setNote(note);
            return this;
        }

        public Builder addHomework(String homework){
            course.setHomework(homework);
            return this;
        }

        public CourseInnerBuilder build(){
            return course;
        }
    }

    public static void main(String[] args) {
        CourseInnerBuilder courseInnerBuilder = new CourseInnerBuilder.Builder()
                .addName("设计模式")
                .addPPT("PPT课件")
                .addVideo("回放视频")
                .addNote("课堂笔记")
                .addHomework("课后作业").build();
        System.out.println(courseInnerBuilder);
    }
}
